#!/bin/bash
platforms=("linux/amd64" "linux/arm64" "darwin/amd64" "darwin/arm64" "windows/amd64")

for platform in "${platforms[@]}"
do
    platform_split=(${platform//\// })
    os=${platform_split[0]}
    arch=${platform_split[1]}
    output_name="$os-$arch-main"

    if [ "$os" = "windows" ]; then
        output_name="${output_name}.exe"
    fi

    echo "Building for $os/$arch..."
    GOOS=$os GOARCH=$arch go build -o $output_name .
done

